set string fname = direlement(string(pathi),value(a))
if ( stringlength(string(fname)) != 17 or stringsnotequal(substring(string(fname),0,3),"img") or stringsnotequal(substring(string(fname),13,4),".pbf") )
then
if (stringsnotequal(substring(string(fname),13,4),".pfm"))
then
print "Alien file '"+ string(fname) +"' in the folder !"
print ""
endif
goto hohma
endif
set string tstr = substring(string(fname),3,10) //Looking for the oldest
call ss
if (value(tnew)<value(oldest))
then
set string dname = string(fname)
set value oldest = value(tnew)
endif
hohma:
set value a = value(a) + 1
if (value(a)<value(b))
then
goto ark
endif
pipka:
if (value(oldest)==2999999999) //If we didn't find any incrementals to delete
then
print "Sorry, but there is nothing to delete."
print ""
exit(2)
endif
print string(dname)
print " will be deleted"
print ""
set value fsize = value(fsize) - filesize(string(pathi)+"/"+string(dname))
filedelete(string(pathi)+"/"+string(dname)) //Deleting incremental and its .pfm